IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'spAttachmentSelectByPressreleaseId') AND type in (N'P', N'PC'))
	DROP PROCEDURE spAttachmentSelectByPressreleaseId
GO

-- =============================================
-- Author:	Nam Tran
-- Create date: Sep 4, 2014
-- Description:	
-- =============================================
CREATE PROCEDURE [dbo].[spAttachmentSelectByPressreleaseId]
	@PressreleaseID BIGINT,
	@LangId INT
AS
BEGIN
	SELECT [Id]
      ,[MediaBinary]
      ,[MimeType]
      ,[Published]
      ,[PressreleaseId]
      ,[FileName]
      ,[Location]
      ,[DisplayOrder]
      ,[LangId]
      ,[IsBlob]
      ,[CreatedOn]
      ,[UpdatedOn]
	FROM [Attachment]
	WHERE [PressreleaseId] = @PressreleaseID AND [LangId] = @LangId
END